package com.data.app.pojo.primary;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "org_division", schema = "base", catalog = "")
public class DivisionEntity {
    private String divisionId;
    private String divisionCode;
    private String divisionName;
    private String parentId;
    private String allParentId;
    private String divisionLevel;
    private String divisionType;
    private String region;
    private String isValid;
    private String createUser;
    private Timestamp createTime;
    private String updateUser;
    private Timestamp updateTime;


    @Id
    @Column(name = "division_id", nullable = false, length = 32)
    public String getDivisionId() {
        return divisionId;
    }

    public void setDivisionId(String divisionId) {
        this.divisionId = divisionId;
    }

    @Basic
    @Column(name = "division_code", nullable = false, length = 32)
    public String getDivisionCode() {
        return divisionCode;
    }

    public void setDivisionCode(String divisionCode) {
        this.divisionCode = divisionCode;
    }

    @Basic
    @Column(name = "division_name", nullable = false, length = 128)
    public String getDivisionName() {
        return divisionName;
    }

    public void setDivisionName(String divisionName) {
        this.divisionName = divisionName;
    }

    @Basic
    @Column(name = "parent_id", nullable = true, length = 32)
    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    @Basic
    @Column(name = "all_parent_id", nullable = false, length = 4000)
    public String getAllParentId() {
        return allParentId;
    }

    public void setAllParentId(String allParentId) {
        this.allParentId = allParentId;
    }

    @Basic
    @Column(name = "division_level", nullable = false, length = 1)
    public String getDivisionLevel() {
        return divisionLevel;
    }

    public void setDivisionLevel(String divisionLevel) {
        this.divisionLevel = divisionLevel;
    }

    @Basic
    @Column(name = "division_type", nullable = false, length = 45)
    public String getDivisionType() {
        return divisionType;
    }

    public void setDivisionType(String divisionType) {
        this.divisionType = divisionType;
    }

    @Basic
    @Column(name = "region", nullable = false, length = 2)
    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    @Basic
    @Column(name = "is_valid", nullable = false, length = 1)
    public String getIsValid() {
        return isValid;
    }

    public void setIsValid(String isValid) {
        this.isValid = isValid;
    }

    @Basic
    @Column(name = "create_user", nullable = false, length = 32)
    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    @Basic
    @Column(name = "create_time", nullable = false)
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_user", nullable = true, length = 32)
    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    @Basic
    @Column(name = "update_time", nullable = true)
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DivisionEntity that = (DivisionEntity) o;
        return Objects.equals(divisionId, that.divisionId) && Objects.equals(divisionCode, that.divisionCode) && Objects.equals(divisionName, that.divisionName) && Objects.equals(parentId, that.parentId) && Objects.equals(allParentId, that.allParentId) && Objects.equals(divisionLevel, that.divisionLevel) && Objects.equals(divisionType, that.divisionType) && Objects.equals(region, that.region) && Objects.equals(isValid, that.isValid) && Objects.equals(createUser, that.createUser) && Objects.equals(createTime, that.createTime) && Objects.equals(updateUser, that.updateUser) && Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(divisionId, divisionCode, divisionName, parentId, allParentId, divisionLevel, divisionType, region, isValid, createUser, createTime, updateUser, updateTime);
    }
}
